package com.tcm.ucenter.mapper;

import com.tcm.ucenter.domain.dto.UserAddressDTO;
import com.tcm.ucenter.domain.entity.UserAddress;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserAddressMapper {
    int deleteById(Long id);

    int deleteLogicById(Long id);

    int insert(UserAddress record);

    UserAddress findById(Long id);

    int update(UserAddress record);

    /**
     * 分页查询数据
     *
     * @param userId
     * @param offset
     * @param pagesize
     * @return
     */
    List<UserAddress> listPageByUserId(@Param("userId") Long userId, @Param("offset") Long offset,
                                       @Param("pagesize") Long pagesize);

    /**
     * 分页查询数据
     *
     * @param userId
     * @return
     */
    List<UserAddress> listAddressByUserId(@Param("userId") Long userId);

    /**
     * 统计
     *
     * @param userId
     * @return
     */
    Long countByUserId(Long userId);

    UserAddress findDefaultByUserId(Long userId);
}